# -*- coding: utf-8 -*-
"""
author:码同学 极光
date:2023-01-30
desc: 
sample: 
"""
import pytest

list ={'admin','张三','admin'}
@pytest.mark.parametrize('name',list)
def test1(name):
    print(name)


@pytest.mark.parametrize('name,pwd',[('admin','123456'),('test1','123')])
def test2(name,pwd):
    print(name,pwd)

test_data = [
    {
        'case': '登入成功',
        'usr': 'admin',  # 正常登入
        'psw': '123456'
    },
    {
        'case': '账号不存在',
        'usr': 'admin1',  # 账号不存在
        'psw': '123456'
    },
    {
        'case': '密码错误',
        'usr': 'admin',  # 密码错误
        'psw': '12345'
    },
    {
        'case': '账号或密码为空',
        'usr': '',  # 账号或密码为空
        'psw': ''
    },
]

@pytest.mark.parametrize('data',test_data,ids=[data.get("case") for data in test_data])
def test3(data):
    print(data['case'],data['usr'])